<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--
//隐藏变量，存对话框里客户手机号
var smsDlgmobile = new Map();


$(document).ready(function(){
	var editable = ${editable};
	if(!editable){
		  alertMsg.error('对不起，已有短信发出，不能再修改！',{okCall:function(){
			  navTab.closeCurrentTab();
			  }});
		
		}
	initCache();
});



function initCache(){
	var init = $("#smstarget").val();
	if(init=="")return ;
	var arr = init.split(",");
	for(var i=0;i<arr.length;i++){
		smsDlgmobile.put(arr[i],arr[i]);
		}
}
//-->
</script>
<div class="page">
	<div class="pageContent">
		<form id="smstemplateInfo" method="post" action="${ctx }/crm/smstask!save.action" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);">
			<input type="hidden" name="id" value="${id }"/>
			<input type="hidden" name="navTabId" value="smstaskList"/>
			<div class="pageFormContent" layoutH="56">
				<div>
				<p>
					<label>发送者：</label>
					<s:if test="userid!=null">
					<input name="userid" class="required" type="hidden" size="30" value="${userid }" />
					<input name="username" class="required" type="text" size="30" value="${username }" />
					
					</s:if>
					<s:else>
					<input name="userid" class="required" type="hidden" size="30" value="${currUser.id  }" />
					<input name="username" class="required" type="text" size="30" value="${currUser.name }" />
					</s:else>
				</p>
					
				<p>
					<label>计划发送时间：</label>
					<input name="strplantime" id="strplantime"  class="required" type="text" size="30" value="<s:date name="plantime" format="yyyy-MM-dd HH:mm"/>" onClick="WdatePicker({el:'strplantime',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
				</p>	
				</div>
				<div>
				<p class="textareaBar" style="width:600px" >
					<label>接收人：</label>
					<textarea rows="3" cols="50" id="smstarget" class="required" name="target">${target }</textarea>
					<a class="inputButton" href="${ctx }/crm/customer!selectCustomer.action?nameInput=smstarget&field=mobile&selectType=checkbox&cache=smsDlgmobile&keepBy=field" target="dialog" rel="selectCustomerDlg" width="800" height="480">选择客户</a>
					<a class="inputButton" href="${ctx }/account/user!selectUser.action" target="dialog" rel="selectUserDlg" width="800" height="480">本公司员工</a>
				</p>
				<p><br><br><br>
					多个接收人之间，用英文逗号“,”分隔
				</p>
				</div>
				<div >
				<p class="textareaBar" style="width:600px">				
						
					<label>短信内容：</label>
					<textarea rows="10" cols="50" name="msg" id="msg" class="required" >${msg}</textarea>
					<a class="inputButton" href="${ctx }/crm/smstemplate!selectTemplate.action?inputId=msg" target="dialog" rel="smstemplateDlg" width="600" height="480" >选择模板</a>
				</p>	
				</div>

				<p>
				<label>更新时间：</label>
				<input name="updatedate"  class="required" type="text" size="30" value="<s:date name="updatedate" format="yyyy-MM-dd HH:mm"/>" />
				</p>
	
			</div>
			<div class="formBar">
				<ul>
					<!--<li><a class="buttonActive" href="#"><span>保存</span></a></li>-->
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="Button" onclick="navTab.closeCurrentTab()">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>
</div>